package me.zhengjie.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.annotation.rest.AnonymousGetMapping;
import me.zhengjie.annotation.rest.AnonymousPostMapping;
import me.zhengjie.pojo.PageVo;
import me.zhengjie.pojo.ResultVo;
import me.zhengjie.pojo.StuScoreVo;
import me.zhengjie.service.CountChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 描述
 *
 * @Author xulitao
 * @Date 2022/3/12
 * @Version 1.0
 */
@RestController
@RequestMapping("/echart")
@CrossOrigin
@Api("统计模块")
public class CountChartController {

    @Autowired
    private CountChartService service;

    @AnonymousGetMapping("/getScoreCount")
    @ApiOperation("统计课程成绩 type:1-学生 2-老师 3-课程")
    public ResultVo queryStuScore(@RequestParam String type) {
        return service.getScore(type);
    }

    @AnonymousPostMapping("/getPlayNum")
    @ApiOperation("统计学生互动情况")
    public ResultVo getPlayNum() {
        return service.getPlayNum();
    }

    @AnonymousGetMapping("/getWorkNum")
    @ApiOperation("统计作业完成度情况 type:1-学生 2-老师")
    public ResultVo getWorkNum(@RequestParam String type) {
        return service.getWorkNum(type);
    }












}
